<?php
namespace Home\Controller;
use Think\Controller;
use App\Controller\BaseController;
class BookController extends BaseController {

    public function _initialize(){
    	//php判断客户端是否为手机
        $agent = $_SERVER['HTTP_USER_AGENT'];
        if(strpos($agent,"NetFront") || strpos($agent,"iPhone") || strpos($agent,"MIDP-2.0") || strpos($agent,"Opera Mini") || strpos($agent,"UCWEB") || strpos($agent,"Android") || strpos($agent,"Windows CE") || strpos($agent,"SymbianOS"))
        header("Location:http://xuancode.com/midi/index.php/Web/");
        //如果session存在，传递用户信息
        $midiuser = session('midiuser');
        $this->assign('midiuser',$midiuser);
    }

    public function index(){

        $this->display();
    }
}